-- GENERATED SPELL FOR [Image of Medivh] --


function spell0_17651(pUnit, Event) --@Begin Frost Breath Attack,Self--
pUnit:FullCastSpellOnTarget(30974,pUnit)
pUnit:RegisterEvent('Sorts_17651', 621, 1)
end

function spell1_17651(pUnit, Event) --@Conflagration Blast,n/a--
pUnit:FullCastSpellOnTarget(30977,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17651', 0, 1)
end

function spell2_17651(pUnit, Event) --@Evocation,Self--
pUnit:FullCastSpellOnTarget(30972,pUnit)
pUnit:RegisterEvent('Sorts_17651', 597, 1)
end

function spell3_17651(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(30967,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17651', 5000, 1)
end

function spell4_17651(pUnit, Event) --@Fly to Death Location,n/a--
pUnit:FullCastSpellOnTarget(30936,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17651', 591, 1)
end

function spell5_17651(pUnit, Event) --@Mana Shield,Self--
pUnit:FullCastSpellOnTarget(30973,pUnit)
pUnit:RegisterEvent('Sorts_17651', 668, 1)
end

function Sorts_17651(pUnit, Event)
local choix_sorts_17651 = math.random(0, 5)
if choix_sorts_17651 == 0 then
pUnit:RegisterEvent('spell0_17651', 1, 1)
end
if choix_sorts_17651 == 1 then
pUnit:RegisterEvent('spell1_17651', 1, 1)
end
if choix_sorts_17651 == 2 then
pUnit:RegisterEvent('spell2_17651', 1, 1)
end
if choix_sorts_17651 == 3 then
pUnit:RegisterEvent('spell3_17651', 1, 1)
end
if choix_sorts_17651 == 4 then
pUnit:RegisterEvent('spell4_17651', 1, 1)
end
if choix_sorts_17651 == 5 then
pUnit:RegisterEvent('spell5_17651', 1, 1)
end
end

function mob17651_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17651', math.random(1500, 3000), 1)
end

function mob17651_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17651_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17651_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17651, 1, 'mob17651_Action')
RegisterUnitEvent(17651, 2, 'mob17651_Leave')
RegisterUnitEvent(17651, 3, 'mob17651_Kill')
RegisterUnitEvent(17651, 4, 'mob17651_Die')
